
const path =require('path');

const htmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: './src/main.js',
  output: {
    path: path.join(__dirname,"dist"),
    filename: 'bundle.js'
  },
  module: {
    loaders: [
            {
                test:/\.vue$/,
                loader:'vue-loader'
            },
             {
                test: /\.css$/,
                loader: 'style-loader!css-loader'
            },
            {
                test: /\.(png|ttf|svg|gif)$/,
                loader: 'url-loader?limit=4000'
            },
            {
                test: /\.vue-preview.src.*?js$/,
                loader: 'babel'
            }
 
    ]
  },
  //插件
  plugins:[
        new htmlWebpackPlugin({
            title:'index',
            filename:'index.html', //在内存中生成的网页的名称
            template:'./dist/index.html' //生成网页名称的依据
        })
    ]
}